<template>
	<view class="head-custom">
		<!-- 		<view :style="{ height: statusBarHeight + 'px' }"></view>
		<view class="nav" @click="goback">
			研如意
		</view> -->
		<u-navbar :placeholder="true" :title="title">

			<view class="u-nav-slot" slot="left">
				<u-icon v-if="back" name="arrow-left" size="19" @click="goback"></u-icon>
				<u-line v-if="home" direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
				<u-icon v-if="home" name="home" size="20" @click="gohome"></u-icon>
			</view>
		</u-navbar>
	</view>
</template>

<script>
	export default {
		props:{
			back:{
				type:Boolean,
				default:true
			},
			home:{
				type:Boolean,
				default:true
			},
			title:{
				type:String,
				default:''
			}
		},
		data() {
			return {
				statusBarHeight: ''
			};
		},
		mounted() {
			//必须放在mounted钩子函数最前面，不能放在调用其它方法后面，否则无效
			// let that = this
			// //获取手机系统信息
			// const info = uni.getSystemInfoSync()
			// //设置状态栏高度
			// this.statusBarHeight = info.statusBarHeight
			// console.log('this.statusBarHeight', this.statusBarHeight)
			// that.getPersoanalInfo()
			//    that.initSortable()
		},
		methods: {
			goback() {
				uni.navigateBack({
					delta: 1
				})
			},
			gohome() {
				uni.switchTab({
					url:'/pages/index/index'
				})
			}
		}

	};
</script>
<style scoped lang="scss">
	.nav {
		display: flex;
		height: 88rpx;
		line-height: 88rpx;
	}

	.u-nav-slot {
		display: flex;
	}
</style>